home *** CD-ROM | disk | FTP | other *** search
- global cQMOffset, cBound, gQMObjList, gAddressList, cStageH, cStageW, gReleaseTime, gReleaseAtTime, gTrackingList
-
- on startMovie
- set the randomSeed to the ticks
- preLoadCast(25, 51)
- setConstants()
- setGlobals()
- liberateQM(getAt(gQMObjList, 1))
- end
-
- on setConstants
- set stageH to the stageBottom - the stageTop
- set stageW to the stageRight - the stageLeft
- set leftEdge to 91
- set topEdge to 36
- set baseCastNum to the number of member "QM1"
- set baseWidth to the width of cast baseCastNum / 2
- set baseHeight to the height of cast baseCastNum / 2
- set cBound to rect(leftEdge + baseWidth, topEdge + baseHeight, stageW - baseWidth, stageH - baseHeight)
- set cQMOffset to 20
- end
-
- on setGlobals
- set gQMObjList to []
- repeat with x = 1 to 10
- add(gQMObjList, new(script "QMs Parent Script", x))
- puppetSprite(x + cQMOffset, 1)
- end repeat
- set gReleaseTime to the ticks
- set gTrackingList to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- set gReleaseAtTime to 500
- end
-
- on animateQMs
- repeat with t = 1 to 10
- QMAction(getAt(gQMObjList, t))
- end repeat
- if (the ticks - gReleaseTime) > gReleaseAtTime then
- repeat with x = 1 to count(gTrackingList)
- set spriteToTry to x
- set whichOne to getAt(gTrackingList, spriteToTry)
- if not whichOne then
- liberateQM(getAt(gQMObjList, spriteToTry))
- exit repeat
- end if
- end repeat
- set gReleaseTime to the ticks
- end if
- end
-
- on randomInRange low, high
- return low + random(high - low + 1) - 1
- end
-
- on moveQMs
- repeat with t = 1 to count(gQMObjList)
- animateQMs(getAt(gQMObjList, t))
- end repeat
- end
-
- on rollColors
- repeat with x = 2 to 9
- if rollOver(x) then
- puppetSprite(x, 1)
- set the ink of sprite x to 0
- updateStage()
- exit repeat
- end if
- end repeat
- set the ink of sprite x to 5
- puppetSprite(x, 0)
- updateStage()
- end
-